﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AvansRS.Domain;
using FluentNHibernate.Mapping;

namespace AvansRS.Data.Mapping
{
    public class PersonMap : ClassMap<Person>
    {
        public PersonMap()
        {
            Id(x => x.ID);
            Map(x => x.FirstName);
            Map(x => x.SurName);
            
            Map(x => x.Number);
            References(x => x.Account)
                .Not.LazyLoad();
            References(x => x.DocentDetails)
                .Not.LazyLoad();
            References(x => x.StudentDetails)
                .Not.LazyLoad();
           // HasManyToMany(x => x.Appointments).AsBag();
            References(x => x.Entity)
                .Not.LazyLoad();
            References(x => x.Academy)
                .Not.LazyLoad();
            References(x => x.Study)
                .Not.LazyLoad();

        }
    }
}
